fixing base64 image encoding