Fix thumbnail position calculation for square images
Merge pull request #1092 from nlegoff/fix-square-calculation

[3.8.4] Fix square thumbnail position calculation