added test. added example. added callback when image is flipped. refactored some stuff.