Im not entirely sure how I would go about this but I feel like the main issue youre running into is that the highlights in the input image are too blown out. I would start by evening out the lighting in the original image before extracting the fingerprints. You could either bring the whites down in brightness or do a more complicated approach with highlights.
You could probably find an open source image editor with that functionality and just copy over what you need into a function in your script then run the rest of your script on the modified image.