improved thumbnail handling
Merge branch 'release/4.1.40'