I would like to customize Insert Image to do the following:
1. Set some attributes on the img element rigtht before it gets inserted into the document.
2. Control where the img element is inserted. Normally the dialog will insert the image at the current caret position (or selection). However under certain circumstances I would like the img inserted at a different location. For example - inside specific div element.
What is the best way to achieve these?