added base64 encoding of images