Updated avatar handling to use media library

Signed-off-by: Tom Wright <tom@inflatablecookie.com>