Fix fetching accounts by JIDs

Fixes a crash when publishing an avatar
Merge pull request #673 from SamWhited/development

Fix fetching accounts by JIDs