Search for images that width and height is more than 500

You can run your $matches through the getimagesize() function to check it’s dimensions, the problem is this function requires a path to the image but your content will provide full URL’s so you’ll need to see if the image is also saved in your media library and if so grab the relative path only. If a lot of the images are from 3rd party sites it’s more complex as you’ll need to fetch the image or you would need to use javascript instead.

Example if your images are hosted on your own site:

$images = array();

foreach ( $matches[1] as $match ) {

    $attachment_id = attachment_url_to_postid( $match );

    if ( $attachment_id ) {

        $path = get_attached_file( $attachment_id );

        list( $width, $height ) = getimagesize( $path );

        if ( $width > 500 && $height > 500 ) {

            $images[$match];

        }

    }

}

var_dump( $images );