catching expcetion in imagick