I tried replicating the steps shown above
Using this command,
finalGraph = SimpleGraph@First@ConnectedGraphComponents[graph]
gives,

I notice additional terminal edges in the graph. Whereas, in the finalGraph
that shows a comparison with the original, I don't see any additional edges.
Indeed the image that I obtained after using the command given below has additional terminal edges and nodes,
skeleton = Pruning[Pruning@Thinning[bin], 15]

Also, could you please explain how the last image has been obtained? I'm curious to know how the graph has been overlapped on the original image.
Thanks a lot for the tip on indexGraph
command. I'm looking for something like the example shown here, where the index of the nodes are displayed on the graph. I used those command for translating the finalGraph
into a graph that displays the indices of nodes and edges. However, I suspect something went wrong, I could only get a square block.
Many thanks for the wonderful support