Do not write tag values twice.
Attach the image's {Exif,Iptc,Xmp}Data to a tag when it is assigned to an image.
Remove redundant code that would set the value of a tag twice (in the tag itself, and in the image).
Remove the now useless metadata attribute.