Corrected method signatures to be the right way round. Fixed bug in getting image mime-type.