Improved avatar_template selection.