refactored image endpoint; added mocked tests and test for 0.9;