add base64 encoding for the uploaded image