changed upload functions and resizing