I apologize. I misread how you were storing the image. My method would work if you were using a "File upload" form field in your document type. Which I find to be the preferable way to associate an image with a document.
Try using GetDocumentUrl(Image) instead of GetFileUrl(Image)
The way you're doing it isn't the safest way to do it as far as compatibility goes.
Here I have updated my code snippet for you.
//create an instance of a TreeProvider, optionally set it to work as though the administrator were accessing it
TreeProvider tree = new TreeProvider(UserInfoProvider.GetUserInfo("administrator"));
//Query the tree
var myDocs = tree.SelectNodes(CMSContext.CurrentSiteName, "/%", TreeProvider.ALL_CULTURES, true, "custom.MyItem", null, "NodeOrder", -1, true);
//make sure the result is not null or empty
if (!DataHelper.DataSourceIsEmpty(myDocs))
{
//access the results as TreeNode types
foreach (var n in myDocs.Items)
{
// create a new macro resolver for the item
MacroResolver res = new MacroResolver();
// add the item as sourcedata
res.SourceData = new object[] { n };
//use K# macros to output your markup
output += res.ResolveMacros(@"<img alt=""{%HTMLEncode(Title)%}"" src=""{%GetDocumentUrl(Image)%}"">");
}
}