Fix pasting image to upload

Tested on Firefox and Chrome