blockfun bugfix - it used to not respect boundaries of the image. iprintf updated - runs faster.