I still prefer to see this in a class e.g. OC_Core_Avatar_Controller and each http method in it's own method.
As reference: have a look at OC_Core_LostPassword_Controller

Possible location:
core/avatar/controller.php