```python ... crop = img[max(0, extra // 2 + 1):min(-1, -(extra // 2)), :] ... ``` The result will not be a square when extra is 1. For example, the ```crop``` is ```img[1:-1, :]``` when ```extra``` is 1. It should be: ```python ... crop = img[extra // 2:-(extra // 2) - 1, :] ... ```