Fix gravatarLookup method

Closes #4511
- Add missing "return"
- Fix error handling
Merge pull request #4512 from sanddudu/patch-3

Fix gravatarLookup method