Revert "Fixed encoding of image previews"

This reverts commit a69307f02582112392bf261cefaf21bcc1824387.