nlmeans/denoiseprofile: prevent system hanging with very small input images