BUG: numpy version checking in ndimage

(cherry picked from commit 8d445c931c96c9d3f6d9fa7bece57d986de02945)