Similar logic to D7402 but for thread avatars. In addition to creating the selector, I needed to create a small utility function: `getAvatarForThread` which factors out most of the logic in `useAvatarForThread` but now we can use this logic in the selector
Depends on D7424