imaging: Fix pyflakes warnings