Fixed the routing bugs for the gallery and settings of friends