adds content-length header if there is one for serving files
sets transfer-encoding chunked for image resizing