HTML is a text based mark-up language, whereas image files are binary, so conversion isn't really possible. What you could do, is read the image files and create an associated html file that links back to the image. I'd do something like this:
/* assumes the images directory is a subdirectory off of where you are processing the script.*/
$myDir="images/";
// get the image file names into an array
$imageNamesArray=glob($myDir . "*.jpg");
//static parts of the file.
$startFile="<html><head><title></title></head><body>";
$endFile="</body></html>";
//process each array item at a time...
foreach($imageNamesArray as $imageName)
{
//Get the base name
$baseNameArr=explode('/',$imageName);
$baseNameArr2=explode('.',$baseNameArr[1]);
$baseName=$baseNameArr2[0];
//Create the file
$myHTML="images/" . $baseName . ".html";
touch($myHTML);
//Now open it and write the contents
$fp=fopen("$myHTML",'a');
fwrite($fp,$startFile);
fwrite($fp,"<img src=\"" . $basename . ".jpg\" />");
fwrite($fp,$endFile);
fclose($fp);
}
Something like this will read all jpg files and create equivalant html files that reference them. Note that the html files are written in the same directory as the image files. You can adapt it as you see fit.