Import script: Make sure medium avatars exist during import.
Import script: Make sure medium avatars exist during import.

During a slack import, we don't have medium-size avatars already
available in the export data set (and possibly also with a normal
import/export?).  The medium size avatar can be created by the
'ensure_medium_avatar_image' function, which checks if the medium
image exists, and if it doesn't, it creates the image.

This commit was substantially edited by tabbott to get rid of an
undefined variable bug, avoid initializing the upload backend classes
in a loop, and add some TODO notes on things that could be improved
later.

hackerkid/zulip,eeshangarg/zulip,tommyip/zulip,rht/zulip,synicalsyntax/zulip,hackerkid/zulip,hackerkid/zulip,tommyip/zulip,zulip/zulip,shubhamdhama/zulip,jackrzhang/zulip,punchagan/zulip,brainwane/zulip,jackrzhang/zulip,dhcrzf/zulip,eeshangarg/zulip,rishig/zulip,dhcrzf/zulip,showell/zulip,brainwane/zulip,shubhamdhama/zulip,andersk/zulip,showell/zulip,brainwane/zulip,kou/zulip,rht/zulip,synicalsyntax/zulip,andersk/zulip,andersk/zulip,synicalsyntax/zulip,dhcrzf/zulip,synicalsyntax/zulip,zulip/zulip,eeshangarg/zulip,synicalsyntax/zulip,zulip/zulip,jackrzhang/zulip,kou/zulip,tommyip/zulip,showell/zulip,zulip/zulip,hackerkid/zulip,andersk/zulip,brainwane/zulip,tommyip/zulip,shubhamdhama/zulip,rishig/zulip,rht/zulip,rishig/zulip,hackerkid/zulip,timabbott/zulip,eeshangarg/zulip,andersk/zulip,shubhamdhama/zulip,timabbott/zulip,kou/zulip,showell/zulip,rht/zulip,kou/zulip,punchagan/zulip,dhcrzf/zulip,zulip/zulip,punchagan/zulip,kou/zulip,eeshangarg/zulip,jackrzhang/zulip,dhcrzf/zulip,timabbott/zulip,jackrzhang/zulip,jackrzhang/zulip,rht/zulip,hackerkid/zulip,timabbott/zulip,rishig/zulip,tommyip/zulip,rishig/zulip,dhcrzf/zulip,brainwane/zulip,showell/zulip,punchagan/zulip,synicalsyntax/zulip,rishig/zulip,dhcrzf/zulip,rht/zulip,shubhamdhama/zulip,kou/zulip,andersk/zulip,timabbott/zulip,brainwane/zulip,showell/zulip,zulip/zulip,timabbott/zulip,eeshangarg/zulip,rishig/zulip,synicalsyntax/zulip,tommyip/zulip,punchagan/zulip,rht/zulip,hackerkid/zulip,andersk/zulip,shubhamdhama/zulip,tommyip/zulip,kou/zulip,punchagan/zulip,timabbott/zulip,eeshangarg/zulip,shubhamdhama/zulip,brainwane/zulip,zulip/zulip,punchagan/zulip,showell/zulip,jackrzhang/zulip