Generate base64 representation of image