Fixed js bug on Files and Images tree

Call observeMethod only if ($(_HANDLER_FORMS.addpage).elements.PageType) exist to prevent javascript error on File & Images page.