or just
```python
if img:
```