For handling the uploaded avatars it would really help if the event core.avatar_driver_upload_move_file_before should also pass the $file object as a var. This way I can quite easily create an extension that offers the functionality of this idea: https://www.phpbb.com/community/viewtopic.php?f=436&t=2437796
I can than simply call $event['file']->set_upload_ary($upload_ary) to overwrite some vars.