Refactored imageupload at login