fixes #101, added maximum number of colums used in the layout as page var

It uses preg_match, so if not needed can be removed, since that saves time in display.