Flip image - ref #98

Also refactored the ResourceManager code, but that will come in another PR.