def build_row(self, line):
        """ Line describes an image or images to show

        Returns a dict with a list of dicts of image names or text items

        Examples:

        # A single image to display
        >>> x.build_row('foo.png')
        [{'image': 'foo.png'}]

        # Two images with text in between:
        >>> x.build_row('foo.png or bar.jpg')
        [{'image': 'foo.png'}, {'text': 'or'}, {'image': 'bar.png'}]

        """

        items = []
        row = dict(items=items)
        fields = line.split(' ')

        image_exts = ['.png', '.jpg']

        # nothing there, carry on
        if not fields: return row

        for field in fields:

            ext = os.path.splitext(field)[-1]

            if ext.lower() in image_exts:
                items.append(
                    dict(image=field))

            else:
                items.append(
                    dict(text=field))

        return row
Line describes an image or images to show

        Returns a dict with a list of dicts of image names or text items

        Examples:

        # A single image to display
        >>> x.build_row('foo.png')
        [{'image': 'foo.png'}]

        # Two images with text in between:
        >>> x.build_row('foo.png or bar.jpg')
        [{'image': 'foo.png'}, {'text': 'or'}, {'image': 'bar.png'}]