Redirect bad pages to 404
Refactor gallery list to make more flexible