fixed marshalling bug with image files where jpegs / pngs would break the code