You provide a default gravatar for everyone to use as a “fall-back” option. Basically you send a query for a given email address to the gravatar.com site, if it has a gravatar associated with that email address, it will be returned to you, otherwise it will use the default gravatar you would have given as part of your query.
The gravatar query is something along the lines of:
https://www.gravatar.com/avatar.php? gravatar_id=279aa12c3326f87c460aa4f31d18a065
&rating=R
&size=40
&default=https://www.somesite.com/someimage.jpg
&border=FF0000
This is all on one line of course. ?? But, anyways, the “default” portion of the URL tells gravatar.com to return that image if it can’t find a valid gravatar.
So in your example, if person “X” didn’t have a gravatar, you would display the default gravatar for them. The moment they get a gravatar, it will be automatically returned from gravatar.com without you having to do anything.
I hope I make sense. ??
Regards