Fixed issue in thumbnail generation