Check that images have valid dimensions (issue 4575)
Merge pull request #4581 from Snuffleupagus/issue-4575

Check that images have valid dimensions (issue 4575)