Avatar stuff

- Fixes a couple of undefined errors for not having an id_attach defined on a clean install.
- If there is already a custom dir for uploaded avatars, attempt to delete the predefined one.
- Add an index.php file to the custom dir for uploaded avatars