added route and controller for avatar

as a fix for issue #5430 I have added the suggested controller and route.