I'll see if I can actually reduce the checking for the image size down to one denominator and create a function for it. I'd actually like to add this to the avatar manager though as this makes more sense to me. A driver that doesn't implement the phpbb_avatar_driver class should still be able to use that function.