public function ampifyImgs() {
        $explodedContent = explode($this->imgSeparator, $this->content);
        $explodedContent = $this->reattachSeparator($explodedContent);

        $newContent = [];

        foreach ($explodedContent as $value) { // every item has one img tag except if the text did not start with an instant <img then the first is without
            
            $srcAttributeExists = preg_match("/src=.*>/", $value);
            
            if($srcAttributeExists == 1) {

                $styleAttributeExists = preg_match("/style=.*>/", $value, $style);
                
                if ($styleAttributeExists == 1) {
                    preg_match("/height:(\d*)px/", $style[0], $height);
                    preg_match("/width:(\d*)px/", $style[0], $width);
                    preg_match("/src=\"(.*?)\"/", $value, $src);
                    preg_match("/alt=\"(.*?)\"/", $value, $alt);

                    $imgHeight = $height[1];
                    $imgWidth  = $width[1];

                    $imgSrc = $src[1];

                    if(isset($alt[1])) {
                        $imgAlt = $alt[1];
                    } else {
                        $imgAlt = ""; // The img alt tag is empty
                    }

                    $ampedImgWithContent = $this->constructAmpImg($value, $imgHeight, $imgWidth, $imgSrc, $imgAlt);

                    // push back the amped content into array
                    array_push($newContent, $ampedImgWithContent);
                } else {
                    throw new \Exception('<img> tags must contain style attribute with height and width.');
                }
                    
            } else if($srcAttributeExists == 0) { // This could be the first item of an array with no img tag
                array_push($newContent, $value);
            }
            
        }
        
        // Re join the amped array items which contained img tags
        $implodedNewContent = implode("", $newContent);
        return $implodedNewContent; 
    }