For Shared Image Galleries, things do get a bit more complicated when multiple tenants are involved. The error you are seeing indicates that you need to sign in with credentials that are authorized to access the linked subscription. For your scenario, it should be as straight forward as changing credentials and repeating the action however this error is more commonly found when attempting to peer VNets and the following thread may offer additional insights when dealing with multiple logins:
https://github.com/MicrosoftDocs/azure-docs/issues/22099#issuecomment-512035524