[ticket/12457] Default to first category if none is selected in gallery avatar

If any category exists, the key() function should always return the first
key of the $avatar_list array.

PHPBB3-12457
Merge pull request #2539 from marc1706/ticket/12457

[ticket/12457] Default to first category if none is selected in gallery avatar

* marc1706/ticket/12457:
  [ticket/12457] Default to first category if none is selected in gallery avatar