Sort page ancestors after depth to ensure correct fullpath