fix return context on avatar upload, refs #312