Fixed problems with inserting images at the caret position.