Moved mercury layout check to pages_controller