resize before sending to server