close the connection when the image is done rendering