thumbnail generation improvement