To support this, always store itemid in metadata; before this was only done when annex.genmetadata was set.