It seems a fix introduced in 3.0.6 was not followed through correctly: http://tracker.phpbb.com/browse/PHPBB3-8317
I have not experienced the issue myself, but it was reported on the Dutch support forum. What is strange, though, is that the user claims they have been using avatars with spaces succesfully before updating to 3.0.6, while the bug fix claims it is needed to be able to use avatars with spaces at all.
Anyway, the attached screenshot is from the support request. It would seem that if the following change is made, it should resolve the issue (untested):