Fix gallery app for non connected user

This patch fix the sso too strict about the gallery app. Indeed non connected user (share link) could'nt see the diaporama.
Concerning /3rdparty /search and /index.php/core , I haven't verified anything. I just realized that it's needed by public page so I skipped it.