Added better priority assignment of images.  Fixes #36