Perltidy.
  Perltidy
  Reworked logic of the loop.

  Move the $suffix outside the glob-loop, since it never changes.
 Change $img -> $file, since that is more descriptive.