Its not just an affliction of the 5100. I have a D3000 and every now and the The camera gets a wild hair and just starts a new folder. If you have setup right in the internal software it should remain the same. Have one folder and name the pictures consecutive order until you change cards. Even The Nikon Transfer software jumps from Transfer and Transfer2 and Back to when that happens Number start over again.
Nikon Software is the hard Mac software to install because the installer doesn't remove the old software. it just adds it to the Nikon Directory and you have to go and dump the old. Everone else if it detects an old version it ask do you want to replace older version new version and restart the application. If you click okay the it moves the old application to Trash and writes the new copy, the closes and restart the new program. Obviously the software engineers are PC only People with little knowledge of how Mac Apps are supposed be installed.
Its a Great camera otherwise when you visit my gallery you can see it makes decent photos.
I've learned to just live with it. and go with the flow.