Fixes wrong avatar url when relative_url_root is used

* Introduced with commit ae564c97d48bf728745c57720734cb40378fd90f
* Affects dashboard view & network view of repo
* JS fix by snowzjx
* fixes #7173 #7164 #7184