Fixed an issue with thumbnail generation