updated thumbnail generation