Refactoring the checkImage and checkImageOrScene functions so that they avoid compiling the same closure over and over again, and reuse that closure to make working Image and Scene type predicates.  No tests yet, but this fixes #239.