fix for encoding and thumbnails