Update the image API

The implementation of many methods have been taken from Tony Allevato's
implementation of the same in the 'media' library. But changes
have been made to confirm to the JES interface.