fix progressive morphological filter to stop at the max window size