Debug template user_galleries
Fix a bug on redirections