def METHOD_NAME(self, sender):
    if self.image_view.parent is self.button_box:
        self.content_box.insert(0, self.image_view)
    elif self.image_view.parent is self.content_box:
        self.button_box.add(self.image_view)