Adaptive window length median based algorithms for removal of impulse and impulsive type degradation in images and videos