Fix base64 encoded JPEGs

Resolves issue #57