Fixed math error with Moore neighbourhoods that were too small. Sample
image processes in about 2.5 seconds on my machine. Added 'median'
colour filter for improved noise removal, but it seems to need more
work as it was not performing as well as the mean filter.