Picture in HTML Viewer

Im trying to display a picture in the html viewer. It will not display. I am setting a picture, then assigning it to a web picture. Then Im using the web picture’s url to display the picture in a table. The picture does not display, only my alt text. Can anyone see anything wrong with this? Thanks.

Dim UserPic As Picture = Session.UserImage
Dim WebPic As WebPicture = UserPic

sHTML=sHTML+"<tr class='ChatRow'>"
sHTML=sHTML+"<td id='UserPicture' width='50px'><img id='UserImage' src='" + WebPic.URL + "' alt='User Image' width=50 height=50></td>"
sHTML=sHTML+"<td id='UserMessage'width='425px'>This is a message.  A very long message to see that it will wrap correctly to  the next line. Even further now to go to a third line to see how it displays. And this is an even longer line to hopefully go into 4 or 5 rows instead of just 3 rows.</td>"

The WebPicture is going out of scope before the image loads in the browser. You need to store the WebPicture as a property if you’re going to use one.

Got it to work. Ended up setting img src to

"data:image/png;base64," + EncodeBase64( Session.UserImage.ToData( Picture.Formats.PNG ), 0 )"