Make image diff code more compact
More improvements to notebook testing