Thank you for the reply.
Updating the editor to latest version didn't solve my problem.
However, I did solve it by changing my code slightly from:
OnClientClick = "PasteHTML('<img src =../filemanager/previewfile.ashx?id=" & e.Item.DataItem("FileID") >')"
to
OnClientClick = "PasteHTML('<img src =""../filemanager/previewfile.ashx?id=" & e.Item.DataItem("FileID") & """>')"