Make this work on big endian machines too
Check near equivalence of images