fixed uploading to server and implementing url to db.

Structure of imageuploading is more organized with proper layers of abstraction.