several improvements to avatar image handling

- fix for infinite progress indicator when user has no avatar image
- better handling of image when a failed http request occurs
- reduced duplicate code for handling swapping authorisation and user info views