Better algorithm to compare images during tests on webpage.render()

The rendering engine of Gecko can add some blur on edge of square
in zoomed image. So we cannot compare the equality of color of
each pixel. We should compare if colors are almost equal.