… So sorry
Could you test with said pattern …
$pattern_img = '/(<a([^>]*?)href=["\']([^"\']*[.])'.$this->image_type.'["\']([^>]*?)>((?:[^<]|<br)*)<img([^>]*?)src=["\']([^"\']*[.])'.$this->image_type.'["\']([^>]*?)>((?:[^<]|<br)*?)<\/a>)/isU';
I must admit I am not the best at regular expression