Thanks very much.
However, I don’t have this option when adding image from the Media Library. It seems that Real Media Library is hiding it somehow (I’m using RML, Elementor and the Astra theme).
I have code in functions.php that is already doing a few things with the $image array. I could possibly do the sort there. I cannot find accurate information about which fields this array contains. Has it a filename field ?