def METHOD_NAME(self, button):
    if self.subject and self.subject.subject and self.subject.subject.content:
        base64_img_bytes = self.subject.subject.content.encode("ascii")
        image_data = base64.decodebytes(base64_img_bytes)
        image = Image.open(io.BytesIO(image_data))
        self.subject.width = image.width
        self.subject.height = image.height