If you want to go the BK route, the game is open source. Just take a look at the code yourself.
Be warned, Goldo is not a programmer, so code quality might not be stellar, and the tag system is also conceptually
really complex. You'll probably have to rewrite the code for your own game from near-scratch. Or zero, if you use something else than Ren'Py (or Python in general).
Essentially, what's going on is that there are 'tags' (and a lot of thought and even fiery discussion has gone into these tags), picture files and Picture objects that merge the two. All girl pack files are parsed at startup (which means the game can take a while to load if you insist on playing with 300+ packs) and strings in filenames are compared against a tag dictionary, added/converted into game tags and then attached to the Picture object along with the filename.
The game basically operates on its knowledge of which tags are attached to which image via Pictures (even if you tag a girl playing with a cat as 'beast service' which
usually means blowing an animal or suchlike
).
There are 'get_pic()' functions that have a whole complex logic chain of which images to pick to account for missing tags, close-enough tags, tag combinations, image variety if there
are enough tags... I guess you'll have to write your own depending on what you want to accomplish in your game. BK, for instance, has a heavy emphasis on girls refusing to get naked while they're still 'fresh off the slave caravan'. Your game might not care as much.
If I were you, I'd just lift the whole tag system (plus the 'extended' tags present in the tagger tool) and
maybe add some of your own if you really need to. This way, you can use the existing BK packs for your game, and I think BK is now the game with the biggest and best (drawn art, 3D and RL pornstars are less well represented) pack collection in existence. Whore Master used to have quite a few of them as well, but I imagine a lot of these might have fallen through the cracks in the interwebs by now, and the tag system was IMO less general.