added before filter to application redirect
refactored galleria pages, used magic encoding gem