Fix metadata <> image IDs