If this is something you're doing inside of XF, you can use the function $User.getAvatarUrl({size}) to grab the URL where {size} would be 's' for small. In a template, for example, you could use this inline
<xf:set var="$image">{$User.getAvatarUrl('s', null, true)}</xf:set>
to set a variable named '$image' to get the user's avatar URL assuming that $User is your user entity. If you're working with a thread then you could use something like
<xf:set var="$image">{$thread.User.getAvatarUrl('s', null, true)}</xf:set>
instead.