add support for writing metadata to an image