More generic code. Pictures size is adjusted to the asciipictures size. Codecleanup