Image to ASCII and some refactoring