<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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 [{'image': 'foo.png'}] # Two images with text in between: [{'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