Your current implemmentation of Gravatar is not forcing emails to lowercase when creating the hash. For example, the email <a href="mailto:MyEmail@gmail.com" rel="nofollow">MyEmail@gmail.com</a> will not return the appropriate Gravatar image because it is expecting the md5 of "<a href="mailto:myemail@gmail.com" rel="nofollow">myemail@gmail.com</a>" instead. This is outlined in Gravatar's documentation: <a href="http://en.gravatar.com/site/implement/hash/" rel="nofollow">http://en.gravatar.com/site/implement/hash/</a> Should be simple. :)