You don't necessarily need an ARexx host for such a task, it's enough if you have a program that can output the information you need. Then you can call it as a command with redirection to a temp file and read that from ARexx.
I made an ARexx script once where I needed such a feature as part of the process, and my solution was to use the picture viewer Visage, which can be called as a Shell command with the INFO argument to output - among other things - the dimensions of the picture (and of course without displaying it).
There may well be other programs that can be used in a similar way, and even some more suitable - e.g. possibly within the NetPBM suite.
Best regards,
Niels