fix display_thumbnail function