fixes #3026 Removing the Page Width from template designer gives JS erro...

...rs

Fixed and tested, committed code for review, please check it.