This shouldn't be done on every page, just the 404.
Also where is the import for plax?
Use postload in the front matter for loading custom JS for a page. (see photos.markdown).