code: def _original_images(self, **kwargs):
          def test(image):
              if not image.original:
                  return False
              for filter, value in kwargs.items():
                  if getattr(image, filter) != value:
                      return False
              return True
          if Session.object_session(self.instance) is None:
              images = []
              for image, store in self._stored_images:
                  if test(image):
                      images.append(image)
              state = instance_state(self.instance)
              try:
                  added = state.committed_state[self.attr.key].added_items
              except KeyError:
                  pass
              else:
                  for image in added:
                      if test(image):
                          images.append(image)
              if self.session:
                  for image in self.session.new:
                      if test(image):
                          images.append(image)
          else:
              query = self.filter_by(original=True, **kwargs)
              images = query.all()
          return images