Convert an Image to Base64 on client side.