Convert an image element to a canvas element