I'm glad you asked! The pictures come from a service called Gravatar.
Click the link above to go there and signup using the same email as you did for PokeBase, to ensure the account is linked properly.
Then you can upload an "avatar". It will be detected automatically and set to your account — use the “My Account" page to choose whether you would like the avatar to be displayed.
Note that the process may not be instant: under normal circumstances, your avatar will take a few minutes to update. If a long time passes and your avatar is not set, double-check your email matches and that the avatar is set active on both Gravatar and PokeBase.