On Meta Stack Exchange there is a rather detailed faq post explaining (among other things) what happens if an account on a Stack Exchange site is deleted: How can I delete my account?
In this specific case, I would like to stress that you're talking about two different MathOverflow accounts.
As you've mentioned in your post, you used to have an account on MO with the userid 37691. As you can check, the page the profile of this account use to be shown returns 404: https://mathoverflow.net/users/37691/daniel-geisler. (However, you can find an old version in the Wayback Machine.) If needed, you can also find posts from that account. However, the old account was removed, the posts posted from that account do not show your username or your photo.
Now you have another account with userid 477396. If you check your account on the main site, you can see that you have created this account on February 19. (See the date shown on the screenshot below.)
The only activity I see on that account is one answer and one comment. The answer was posted on February 19 - so my guess would be that you probably created the account when you posted that answer. (Of course, there is an option to post answers and questions anonymously - you could have done that if that's what you prefer.)
The avatar and username of the newly created account are fully under your control. Since the account is associated with the accounts you have on other Stack Exchange sites, naturally, also the gravatar is the same. (So it's not really correct to say that "MO remembered the avatar" - this was the picture you used when creating the new account.)
