Move logic for rendering texts on CanvasImages to a single class