Better handling of luminosity and mask changes