Change image threshold handling to avoid mask depression