Algorithm to check whether an image is blurry or not