regex failed to scrap all images

I am trying to scrap all images from an e-commerce website using php,
but the problem is it didn’t scrap all images,(30% of image failed to be scraped)
his the code:

    <?phpfor ($i = 2; $i < sizeof($count); $i++) {?>
        <?php preg_match_all('|<img.*?src=['"](.*?)['"].*?>|i', $html, $matches); ?>
        <img src=<?php echo $matches[1][$i] ?> class="card-img-top">
   <?php}?>
    ?>

I couldn’t find the solution , I have tried many regex but none of them worked
can anyone please help me to find a better regex to scrap all images.