To check if the execution is true, you can utilize the following method
if (document.execCommand('insertimage', null, 'http://barwoncopiers.com/wp-content/uploads/2011/03/linkedin-icon-45x45.jpg'))
Once you place the cursor in the edit box and click on the button, observe how the if statement is triggered with tags surrounding your images (inspect using developer tools)
document.getElementById("input").onclick = function() {
if (document.execCommand('insertimage', null, 'http://barwoncopiers.com/wp-content/uploads/2011/03/linkedin-icon-45x45.jpg')) {
var images = document.querySelectorAll("img[src$='wp-content/uploads/2011/03/linkedin-icon-45x45.jpg']");
for (var x = 0; x < images.length; ++x) {
if (images[x].parentNode.tagName != "QWE") {
images[x].outerHTML = "<qwe>" + images[x].outerHTML + "</qwe>";
}
}
}
}
<input id="input" type="button" value="Img" id="in" />
<br>
<div contenteditable="true" class="editor" id="editor">hh</div>