Fixed a bug in bounds detection for tall images