Fixing a bug found for niftis without proper freqdim and phasedim fields.

Discovered by Yonghua Cai at East China Normal University when he created NIFTIs with a different method that did not contain freqdim, phasedim and slicedim. It appears that these fields may not always exist in standard NIFTI structures.