Live Query - need to use MasterKey for pointers but where?

Ive built a chat app. I store pointers to all users in an array:

profiles: [Profile$XyZ, Profile$AbC]

When I subscribe to the Collection client side it works but i need to be able to use masterkey to get both these pointers and convert them into a basic profile. Initially I was just saving the users image and name in this array but its not ideal because if the user updates their photo then it looks terrible if the old one is there or maybe they delete the old photo.

I tried to use the server side hooks but when the client application subscribes to the message threads only the beforeSubscribe hooks gets triggered, im not even sure if its possible to get these user profile pointers and do a query on them to get the full profile using this method.

Any advice for this ? I assume it being live query that eople have built chat applications using it before and keeping profiles in sync must be a common issue

You can either use a trigger or send another api call from the client to a cloud code function that fetches the data using the master key and returns to the client.