add thumbnail
optimize thumbnail generation