If I go to the bottom of the Web Development forum, my logo tells me I have 40 endorsements. As far as I can tell it doesn't count the MySQL ones. In works correctly in the Databases and MySQL sub-forums. (You can also look at utrivedi's profile to confirm).
If you hover to the bottom of Web Dev, it says specificially you have '40 Web Design, HTML and CSS Endorsements'. Endorsements aren't tallyed up within subforums. Your avatar only gets shown if you make the grade within one specific forum/subforum. In this case, out of all of the Web Dev children, you have the most amount of endorsements in the Web Design category, so that's what it shows.