One way to do this is to explicitly base64 encode the image data. Here's an example for PNG file, you'd have to change the HTML source description for others. Remove the "$$REMOVETHIS$$" part - I had to add that or MATLAB answers tries to encode this and it looks all wrong in the browser!
closer = onCleanup(@()fclose(fid));
bytes = fread(fid, inf, "uint8=>uint8");
b64 = matlab.net.base64encode(bytes);
img = ['<img src="$$REMOVETHIS$$data:image/png;base64,' b64 '" width="300" height="300">'];
html = ['<html>' img '</html>'];
fig = uifigure('Position',[561 497 333 239]);
Also note, that if you develop your guide with a MATLAB live script, then you can export the live script to HTML and attach it in this manner. The exported live script already has the embedded figures as base 64. I find this to be a good way to make MATLAB-based documentation.