Fix #883 Resize img accoring to device orientation
Merge pull request #418 from nlegoff/fix_883

[3.8] Fix #883 Resize img accoring to device orientation