According to the javadoc of the Base64.encodeBase64URLSafeString method, that seems to be by design. Check out the link I provided, it says this in the javadoc:
Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The url-safe variation emits - and _ instead of + and / characters. Note: no padding is added.
So you want to make sure you use the url-unsafe variation. That's the method called encodeBase64. Use this method instead:
Base64.encodeBase64(imageFile)