improved image comparison in tests