So you want to display the avatar in question lists as it is in this site, right? If that is the case, then there is no need to code anything.
Navigate to admin/users and locate the Avatar size on question lists setting. Make sure it is set to 20 or whatever positive number makes sense to you. Obviously, make sure you allow your users to use avatars or gravatars :)