FB-14497: Fix js bug when media viewer is not defined.