Sort and validate DICOM data