Some javascript to convert an image to a data url.