The picture would initially load as my current picture, then after a few seconds switch to an old profile pic I used. This can be resolved by always setting userData to the event with the most recent created_at time.
Perhaps in useProfile, before executing setFetchedProfiles, we need to check whether fetchedProfiles[pubkey] already exists; if so, look at created_at to decide whether to update it or not.
I noticed this behavior when trying to create a profile page with my picture on it.
The picture would initially load as my current picture, then after a few seconds switch to an old profile pic I used. This can be resolved by always setting userData to the event with the most recent created_at time.