Fixing cropped images taken upside down

I originally created a new array using np.empty. For the upside down images
the image is shifted so some of the np.empty garbage is never overwritten,
causing gibberish in some of the files. I changes the initializing array to
be zeros instead of empty, this should solve the problems
added code to id nan and inf and extremely large and small numbers