Please remove the TODO and return the base64 encoded string *with* CRLF to be base64 standard compliant. The clients using getImage() can use e.g. apache-commons-codec to decode the base64 encoded string properly.