'Connection: close' is required because the philips library by default uses HTTP 1.1 instead of 1.0. As a result, if you don't have that header, the server is keeping the connection alive and evidently the socket code in the philips library does not like long-lived connections for images.