new upload function, image resizing automatically