method for imagehandler