Fix for thumbnail generation