Provide empty presetting of $GLOBALS[TL_CONFIG][avatar_dir] for Contao 3.1.
Format code.
Make insert tag configurable via query parameters {{avatar[::id][?width=X&height=Y&mode=M&alt=ALT&class=CLASS]}}.
Remove unused variable $db.
Optional resize uploaded images.