In a css sheet (MyStyles.css) stored in you apps root folder, you can set your urls like this:
.someCssClass {
background-image: url('imgs/topbg.png');
background-repeat: no-repeat;
background-position: center center;
text-align: center;
}
Since this image path in the css sheet is relative to where the css sheet is stored it will work whether the web page is pulled from your site root or from a subfolder.
In your masterpage head section you can add a link to that css sheet like this:
<link runat="server"
id="csslnk1"
href="~/MyStyles.css"
rel="stylesheet" type="text/css" />
This link uses a root relative syntax (using the ~/) so the stylesheet can be found no matter what folder/subfolder your page is being pulled from.
Then you can set your td background-image style inside that page by using a class selector like this:
<td class="someCssClass">