The "TargetInnvocationException" exception was actually hiding the underlying problem of a "NotSupportedException" exception which I found after moving ShellTile.ActiveTiles.First().Update()
out of the UI thread.
The exception was still not descriptive as to what the problem was, but after some rummaging through different forums and documentation, I found that the path of the dynamically created image is very important when using it with Live Tiles.
If you are using an image in isolated storage for the purpose of the live tile or shell tile, then the base folder must be
/Shared/ShellContent
After changing
const string filename = "/LiveTiles/LiveTileRegular.jpg";
to
const string filename = "/Shared/ShellContent/LiveTileRegular.jpg";
Everything worked fine.
Could us Windows Phone developers get better exception messaging?!? :)