Refactored - image upload handler function
The function decorates and wrap the on_ methods