Filters masked images using the median. Quite rudimentary yet