def METHOD_NAME(self, template=None):
    '''Return a dictionary representation of the image'''
    # send template to layer's to_dict method
    layer_list = [layer.METHOD_NAME(template) for layer in self.layers]
    image_dict = {}
    if template:
        # use the template mapping for the key name
        for key, prop in prop_names(self):
            if prop in template.image().keys():
                image_dict.update(
                    {template.image()[prop]: self.__dict__[key]})
        # update 'origins' and 'layers' values if mapping exists
        if 'origins' in template.image().keys():
            image_dict.update(
                {template.image()['origins']: self.origins.METHOD_NAME()})
        if 'layers' in template.image().keys():
            image_dict.update({template.image()['layers']: layer_list})
    else:
        # use the property name
        for key, prop in prop_names(self):
            image_dict.update({prop: self.__dict__[key]})
        # update 'origins' and 'layers' lists
        image_dict.update({'layers': layer_list})
        image_dict.update({'origins': self.origins.METHOD_NAME()})
    return image_dict