python: fix typo causing non-square images crash