Magic wand correction

If you tried to apply magic wand on a pixel value of 20, and if magic wand radius was 40 for example, it was failing because the bounds were becoming incorrect.
This PR should correct this behavior.