moved the layer.hasMask() in export_selected_channels so it works on all layers and not just paintableLayers