Custom resizable avatar works

I also reworked the code to be a little more readable