Maybe it’s possible with with the Script-FU or GIMP-python, essentialy you would have to create an external script and run gimp with out the interface. https://www.gimp.org/docs/python/index.html
I used to play with that some time ago. Rotate images with GIMP using Caja's context menu
For image previews qiv is very fast. And it has a lot of command line options for scripting. qiv - Quick image viewer for X
There are lots of image viewers. mirage, nomacs, ristereto, feh…
Is irfanview free (as in freedom) or free (as gratis but closed source)?