Send data to server with ajax and save image