Registration reference photo

Thanks, Team,

Is there a way to add to the script to always pick up the 5th image as the reference frame?
Doing the entire stacking/registering process manually is time-consuming. I find it easier to run the script and walk away.