Fix the image test depending on the image length.

See also issue #7.