Fix incorect layer exclusion.

The script used to generate the background images does not try to exclude a
layer if no exclusion has been requested.