Set the SkinId on the markup
<asp:Image runat="server" id="LogoImage" SkinId="LogoImage" />
To set it programatically you need to set it up on the PreInit event
public void Page_PreInit(object sender, EventArgs e)
{
LogoImage.SkinID = "LogoImage";
}
And here is a blog post for setting the SkinId Programatically
http://blogs.conchango.com/simonevans/archive/2005/06/09/How-to-programmatically-assign-a-SkinID-to-a-control-while-using-a-master-page-in-ASP.net-2.0.aspx
Finally, if you are just looking for the folder, it depends on whether you are using a Theme or a StylesheetTheme.
var path = "~/App_Themes/" + Page.Theme + "/images";
var path = "~/App_Themes/" + Page.StylesheetTheme + "/images";
Update
If you doing this in a Grid use a custom binding method
<asp:Image runat="server" id="myImage" ImageUrl='<%# GetThemedImage(((Product)Container.DataItem).Image)%>' />
then in the code-behind
public string GetThemedImage(string image)
{
return "~/App_Themes/" + Page.Theme + "/images/" + image;
}