Set href attribute of newly inserted image to image title

I'm not sure if that's the long term solution, however for now it fixes bug 49844 and bug 49848.

Change-Id: I75dbbfdd248a6f5696252ef3a2d7ca6ede0fa156
Merge "Set href attribute of newly inserted image to image title"