Whenever I manage to solve a problem with help from people on a forum like this or with examples and explanations posted in personal websites or blogs, my faith in humanity goes back ut another notch. The only thing I can do in return is to post the solution that I came up with in the hope that someone else may find some snippet in it useful.
I tried to follow both approaches renaming and relinking the files and pasting an easily visible label on each photo showing its year. In both these I has helped by the fact that I had originally tried to separate all the photos into folders named for the year I thought it was taken.
I gave up trying to use JavaScript in Visual Studio Code because I could never set it up properly to work for debugging and just went with Applescript which I had already used to link together images in the InDesign document and the corresponding image in a database of all my images.
If I decided I had the wrong year for an image and moved it to a different folder this obviously broke the link in InDesign. The only solution I could figure out for this was to add a field to the database which stored the old name of the file so that I could trigger a search for it from the link information in InDesign and then find the new name and path to use for relinking it. I am attaching the _RelinkerFull.scpt that managed to relink about 30 missing files, before I decided to stop renaming them in favor of just labeling them. One problem I had with the script is that Applescript's do script command for Filemaker does not seem to be smart enough to wait until the sub-script has finished and I finally found advice to put a delay in the script. I could probably have avoided this is I had just done the search with Applescripts own ability to tell Filemaker to search, but I already had a Filemaker script to do the search.
Applying the labels to each image was done with the attached _YearLabelAll.scpt which goes through the links for all the images, finds the year as the name of the folder in which the image is stored and adds a textbox with the year centered over the frame of the cropped image on the page. Sometimes the seemingly basic or trivial things pose the biggest problems for me and in this case it was specifying the color for the font in the textbox. I had to create a swatch in InDesign in order to do this, but I am sure it must be possible some other way. I tried to also group the textbox and the image, but then realized that this prevented me from keeping the image visible when I made the layer for the text box invisible. This script also failed on images that were on the pasteboard rather than on a page, but I only had four of those and I was able to move them to a temporary page and use _YearLabelSelected.scpt to put a lable on just the selected images.
I am sure my scripts are not the most robust or elegant scripts possible for this task, but they worked and I felt I should share them for whatever they may be worth.
I now have discovered that I cannot attach .scpt files to this post so I am attaching a single text file containing all three scripts.