A yet unpublished QGIS plugin to detect intervals of consecutive values
It analizes an text or number attribute of selected features in input layer and rearranges its data into series of continious intervals
An example result
5 intervals in Names:
3295 - 3302, 3318 - 3319, 3327 - 3331, 3344 - 3347, 3349 - 3350
Copy the AttributeIntervals folder to your QGIS profile python plugins folder e.g. default/python/plugins
Activate it in the Plugins > Manage and Install Plugins... window

As an example you cand use a set of photos and add it via Processing toolbox > Vector creation > Import geotagged photos
Choose the field you need, to use a prefix press Get value and edit it so you get a repeating value, press Calculate intervals


