Pulled flipImage out of nearestNeighbour. Closes #132