After you change it via the config.inc.php you need to run a db command to update the database if you are moving the avatars from old dir to new.
Something like this
UPDATE ubbt_USER_PROFILE SET USER_AVATAR = replace(USER_AVATAR, 'http://www.yoursite.com/path_to/images/', 'http://www.yoursite.com/path_to/images/')
I used this when I switched my site to a new domain a few years back.