Cleanup, refactoring, use sharp for for grayscale