 
 cached_avatars = {}
 missing_images = {}
+loaded_images = {}
 
 window.getCanvasAvatar = (user) ->
   cached_avatars[user.key or user] or cached_avatars.default


  load: -> 
    users = fetch '/users'
    return if !users.users 

    loading = fetch('avatar_loading')


          pic = new Image()
          pic.onload = do(user, pic) => => 
            loaded_images[user.avatar_file_name] = cached_avatars[user.key] = @create_avatar pic
            @loading_cnt -= 1
            if @loading_cnt == 0
              loading.loading = false
              loading.loaded = md5 JSON.stringify Object.keys(loaded_images)
              save loading
          pic.onerror = do(user) => =>
            @loading_cnt -= 1
            missing_images[user.avatar_file_name] = 1

          setTimeout do(user, pic) -> -> 
            pic.src = avatarUrl user, 'large'
