save your images in skin1/navpics/ folder and name them so that the file name is that same as the category id with the gif extension.
for example your storage category image should be saved as 103.gif
Code:
<table cellpadding="5" cellspacing="0"><tr>
{section name=cat_num loop=$categories}
<td>
<a href="home.php?cat={$categories[cat_num].categoryid}" >
<img src ="{$ImagesDir}/navpics/{$categories[cat_num].categoryid}.gif">
</a>
</td>
{/section}
</tr>
</table>
you should be able to see what is going on from the code ive supplied now.
theres a setting in general settings about showing subcategories in the categories menu