Read the image file after setting the resource limit constraints.
Use imagick->pingImage to retrieve the image dimensions.

Delegate to the get_image_size method to determine the image validity.