Update better_figures_and_images.py

Change the path extraction method.