Fix fatal crash when adding a new page

Also add images on pages to the drop-down list for image choosing, and fix
display of images on the client portal.
Add `type` column to site pages listing
Merge pull request #146 from greezybacon/issue/131

Fix a few things related to site pages

Reviewed-By: Peter Rotich <peter@osticket.com>