Fix for thumbnail generation.