Added check for when Show Avatars is turned off, fixes #518.
Helper function to get avatars now respects the show_avatar option for special cases, fixes #518
Remove assert
Code formatting and improved docblocks
Code formatting
Make sure avatar exists before img output
Merge pull request #519 from x-team/issue-518

Fix for Show Avatars disabled, issue #518