Fix issue with binary encoded files (images) not getting read and uploading correctly