ImageTools: Correct autoscaling logic

Thanks to Strachu for these corrections.

Fixes for https://github.com/openmicroscopy/bioformats/issues/1303