convert image jpg to base64 encoded image