Scale down avatar images to save memory.

This gets the maximal display size of avatars from the style specification
and downsamples the loaded avatar images to be close to that size, with no
(to me) visible degradation of quality. Bonus: you actually see the rounded
corners of the images now.

Before this patch, each loaded avatar image occupied 850k of RAM, causing
the app to OOM after longer usage. With this patch, one image occupies
50k of RAM, preventing OOMs (device: Moto X).

Fixes #513
Might be a fix for #509