Fixed up ImageWriter util class.