fix user search

 - prevent user search from failing because of invalid avatar ids
 - check for bad (`None`) avatars returned from invalid ids
 - fix #1643