if mpl < 1.2: check for PIL before trying to use mpl's compare_images