Test the thinking in the image utility library.

Also refactored the thinking from the doing to make it easier.