Fix use of generate_thumbnail
pep8