It's because you're getting the avatar inside of a loop. Hence increasing your queries dramatically. Do a LEFT JOIN in the query - or even still there may be a vB3 function to get a user's avatar without using any queries getting it from a cache but don't quote me on it
EDIT- direct from showthread.php:
Code:
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . "