Also close writer since this test previously failed due to truncated output.
Also correct Content-Type when transcoding WebP.