Avatar upload and resize using php and jquery