Problems: Line 27 (photo = ImageTk.PhotoImage(img)) is unnecessary and should be removed. img is a local variable, and Python's garbage collector removes it after the function exits. As a result, the image disappears from image_label. The solution is to store the image as a global variable or an attribute of so that it persists.