This feature doesn't work properly, at least for me it doesn't. If I go to edit account page I have to hit save twice to get the random avatar assigned. After some debugging I find out that at the first save I get only the filename of the avatar and not the full path so my guess is the problem is in
avatar_selection_get_random_image that returns just the name and not the path or further "down" in
_avatar_selection_image_list. Either this or I did something extremely wrong.