Moved avatar creation function to bp-groups-template.php from functions file