Resize images before uploading them to the server.