python base64 encode image to string