Hi,
That means you are trying to index into the avatar list with a value greater than the size of the list. Are you deleting items from the avatar list after you create it? If so then you need to change the way you increment to the next avatar:
Code:
nextAvatar = (nextAvatar + 1) % len(avatars)