Fix avatar/minipic refresh issues, and make the internal avatar/minipic system less hacky.

Owners of already existing boards will need to run the provided fixavatars.php file.