Converting string to web-safe Base64 format
The API requires you to use URL-safe base64 encoding. After doing the base64 encoding, try replacing / with _ and + with -. Details at: https://developers.google.com/admin-sdk/directory/v1/reference/users/photos/update