fix coordinate problem with large images - bug 1523
Merge pull request #2739 from StevenPuttemans:bug_1523