Fix an image related selection issue

At the moment if user start a selection in text and then release the mouse on an
image. It loses the selection and just selects the image.