Generate avatars with transparent background

Generate avatars with transparent background (for .png images) or with white background (for others).
Merge pull request #1328 from abbat/patch-1

Generate avatars with transparent background