Added Gallery Controller

Further minimized implementation and added controller to handle page
traversing and error handling.