It'd be easier to understand if the logic followed the format of the comment, eg:

```
// Dump out the image.  Movie and album thumbnails are always JPGs
if (($item->is_movie() || $item->is_album) && $type == "thumbs") {
  ...
}
```