Compress images to data url

If you drag and drop an image that is too big, the image is
automatically scaled down and turned into a data url.