Fixes an issue where the image is not encoded correct into base64

Jira issue: APPPARTY-51