@mustafamteck Has a great point!
If in the frontend you can do this image by image then you can access its dimensions to establish conditions: