added registration and fixed upload img bug