BUG: was using mean instead of image for nhood