Fixes #7647: Added support for external registries

Small thing but I wonder if this should be a `has_many :through` or a `habtm` reason being that images should be universally unique (like git commits). So one image could belong to multiple registries.