Fix thumbnail generation