def _related_used_by(remote, entry):
    """Factory returning related storage resources for `used_by`."""
    collections = remote.containers, remote.images, remote.profiles
    for collection in collections:
        if entry.startswith(collection.uri):
            return collection.get_resource(entry)
    return entry
