title: base64 converted photo from Graph displays as broken image
body: <p>I've racked my brain (and others) trying to get this to work. I am pulling a photo via MS Graph API - this part works fine. I am able to receive the data (as bytes). However, I can't get the image to convert properly to be attached as a file and posted.</p>
  
  <p>I have read several postings on SO and GH as well as having tried ~10 different npm packages and flavors(btoa, atob, etc...out of desperation), including the JS example from the <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/profilephoto_get" rel="nofollow noreferrer">Graph docs</a>. No solution has worked. The npm packages all produce different outputs from one another and none of them match the output when I take the photo and upload to an online base64 converter. In addition, if I take the online conversion and place the output string directly into the code, it works.</p>
  
  <p>Here is the current iteration of my code. Any help would be appreciated.</p>
  
  <pre><code>var optionsPhoto = {
    url: "https://graph.microsoft.com/v1.0/me/photo/$value",
    method: "GET",
    headers: {
      Authorization: "Bearer " + token
    }
  };
  
  await request(optionsPhoto, function callback(error, response, body) {
    if (!error &amp;&amp; response.statusCode == 200) {
      photoResponse.data = [
        {
          "@odata.type": "#microsoft.graph.fileAttachment",
          contentBytes: body.split(",").toString("base64"),
          contentLocation: "https://graph.microsoft.com/v1.0/me/photo/$value",
          isinline: true,
          Name: "mypic.jpg"
        }
      ];
      photoResponse.ContentType = response.headers["content-type"].toString();
      photoResponse.Base64string = (
        "data:" +
        photoResponse.ContentType +
        ";base64," +
        photoResponse.data[0].contentBytes
      ).toString();
    } else {
      console.log(error);
    }
  });
  </code></pre>
  
  <p>The <code>.sendActivity</code> command takes the attachment only as seen below:</p>
  
  <pre><code>await dc.context.sendActivity({
    attachments: [
      { contentType: photoResponse.ContentType, contentUrl: photoResponse.Base64string }
    ]
  });
  </code></pre>