cms and gallery relation