Update compare-images.pl

additional bug fix