[feature/avatars] Correct license, copyright and package info

PHPBB3-10018
[feature/avatars] Use deprecated for compatibility function

Also moved use of global variables inside the only if statement they are
used in.

PHPBB3-10018