     match = /data:image\/(.*);base64,(.*)$/.exec(rawImage)
 
     if match != null
-      imageBase64 = match[0]
       imageType = match[1]
       imageBase64 = match[2]
       src = if useCid then "cid:uploaded_image#{index}" else rawImage
-      message.body = message.body.replace "{image#{index}}", "<img src='#{src}' style='max-width: 900px;' />"
+      message.body = message.body.replace "{image#{index}}", "<div style='width: 100%;'><img src='#{src}' style='max-width: 900px;' /></div>"
 
       if useCid
         message.cids = addImageInMessageCid(message, "image/#{imageType}","Uploaded Image #{index}", imageBase64, "uploaded_image#{index}")

          continue
      markdownMessage += sections[section] + "\n\n"
    htmlMessage = converter.makeHtml markdownMessage
    uploadedImages = []
    uploadedImages =
      1: sections["progressImage"]?.raw,
      2: sections["progressImage2"]?.raw,

        subject: prebuildMessage.subject
        body: prebuildMessage.body

      renderUploadedImages(previewMessage, false)

      renderBDC previewMessage, svg, false
  buildCid: ->
    dynamicFieldsPromise.then (builtDict) ->
      renderImages(prebuildMessage, _svg, true)
