Whenever I attempt to upload an avatar, I get an error.
/avatars and /images are both owned by www-data.
To test to see if it was caused by an issue with my mediawiki installation and database I created a new installation and database on my server. On this new server, I still had the exact same error.
Here's an example of the error messages that I get: