Enhance thumbnail display
Merge pull request #1071 from nlegoff/thumbnail_display_cleanup

[3.8] Enhance display code of thumbnails