added handling for multiple nifti inputs