If you are working with a lot of images, at different sizes, for whatever reason: then you may want to take a looooong look at this great stack:
@habitualshaker also has set up a free routine that works with the great Retrobatch. I’m sure he’d be willing to share with you if you are interested. Retrobatch you can learn about more here:
It comes in a regular and pro version. The differences explained here:
https://flyingmeat.com/retrobatch/docs-1.0/provsregular/
A wee bit more is included in this discussion: