deleted duplication code, added abstract class TextImage