for i, sponsor_id in enumerate(sponsor_ids):
simg = Image.open(sponsors[sponsor_id].logo.path)
if simg.size[0] > THUMB_WIDTH or simg.size[1] > THUMB_HEIGHT:
for i, sponsor_id in enumerate(sponsor_ids):
simg = Image.open(sponsors[sponsor_id].logo.path)
if simg.size[0] > THUMB_WIDTH or simg.size[1] > THUMB_HEIGHT: