Align filename prefix splitting with WebDataset library
Align filename prefix splitting with WebDataset library.

This PR uses the same `base_plus_ext` function as the one used by the `webdataset` library.

Fix #7150.

Related to #7144.