Removed the image flipping as it was taking up a significant portion of the processing time. Also inverted the vertical axis for images so it has a right handed coordinate system.