[Fixes bug #1179363] Fix crash when pasting into a new image with an old image on the clipboard.