BUG: ndimage: use only normalized type_num in comparisons

Numpy type_num cannot be used in comparisons, since some of the values are equivalent, depending on the platform.