Is it possible to have htlatex generate side-by-side subfigures? The mwe tex file
\documentclass{article}
\ifdefined\HCode
\usepackage[compatibility=false]{caption}
\def\pgfsysdriver{pgfsys-tex4ht.def}
\else
\usepackage[]{caption}
\fi
\usepackage{subcaption}
\usepackage[]{graphicx}
\begin{document}
\begin{figure}[htpb]
\centering
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{image1.png}
\caption{Image 1}
\end{subfigure}
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{image2.png}
\caption{Image 2}
\end{subfigure}
\caption{Main Caption}
\end{figure}
\end{document}
together with the config file
\Preamble{html}
\Configure{@HEAD}{\HCode{<link href="basic.css" rel="stylesheet" type="text/css" />\Hnewline}}
\ConfigureEnv{figure}
{\HCode{<div class="figure"\Hnewline>}%
\bgroup \Configure{float}{\ShowPar}{}{}%
}
{\egroup
\HCode{</div>}\ShowPar
\par}
{}{}
\Css{div.caption {text-align:left;font-size:83\%;text-indent:0em; margin-left:2em; margin-right:2em; }}
\Css{div.caption span.id{font-variant: small-caps; white-space: nowrap; }}
\Css{.figure div.caption{text-align: center;}}
\Css{div.figure{text-align:center;clear:both;overflow:auto;width:100\%;margin-bottom:1em;}}
\begin{document}
\makeatletter
% Various helper functions
% default font size
\newcommand\emwidth{16}
\let\emwidth\f@size
% convert pt to rem
\newcommand\CalcRem[1]{\strip@pt\dimexpr(#1)/\emwidth}
\Configure{graphics*}
{png}
{% we must add the image to the list of output files
\special{t4ht+@File: \csname Gin@base\endcsname.png}
\Picture[pict]{\csname Gin@base\endcsname\PictExt
\space style="width:\CalcRem{\Gin@req@width}em;"
}%
}
\makeatother
\EndPreamble
generates

I have read this threads:
But, I cannot piece together how I might achieve the desired result. I have included the graphics configuration in the .cfg file because it is important that I be able to scale the images.
