code: public function photo($sImgUrl)
      {
          $bIsImgExt = strtolower(substr(strrchr($sImgUrl, '.'), 1)); // Get the file extension.
  
          if ($bIsImgExt == 'jpeg' || $bIsImgExt == 'jpg' || $bIsImgExt == 'png' || $bIsImgExt == 'gif') {
              $sExt = strtoupper($bIsImgExt);
          } else {
              throw new InvalidArgumentException('Invalid format Image!');
          }
  
          $this->sData .= 'PHOTO;VALUE=URL;TYPE=' . $sExt . ':' . $sImgUrl . "\n";
  
          return $this;
      }
docs: Photo (avatar).
  
  @param string $sImgUrl URL of the image.
  
  @return self
  
  @throws InvalidArgumentException If the image format is invalid.