Caching the html in the database wouldn't do much of a difference, or am I missing something?
if( $cur_topic['avatar'] != '' )
echo '<img src="'.$cur_topic['avatar'].'"/>';
As I see it, caching the html would require two fields, the html and the path to the avatar, while caching the url/path instead requires just one, and gives the same performance.
Hmm, someone might already have said this.
As for file_exists vs db fields go, there is some upsides to db fields. One is external avatars, and avatars from different systems. File_exists requires workarounds or editing the code, while a db field can be changed by an extensions quite easily.