fixed calc. of deviation in compare_tiff