Move avatar resize logic in one place