title: tkinter: Help fixing photo image error created when same window opened twice
body: <p><strong>I think I've pretty much narrowed down the problem, so I'll put it out here:</strong> </p>
  
  <p>I made a change to the program I am working on. The change makes a certain tkinter window reopen when an error occurs. This was done by moving it to a function, and having the script call the function if it needed to. This solved users having to restart the program.</p>
  
  <p>All the windows in my program have an icon that is called and implemented in every window using the following lines:</p>
  
  <pre><code>Thumbnail = PhotoImage(file = "C:\\Users\\Owatch\\Pictures\\NetSendClient\\files\\GIF\\TK_ICON.gif")
      Window.tk.call("wm","iconphoto",Window._w, Thumbnail)
  </code></pre>
  
  <p>This works fine for every single window across the program. However, it continues to generate an error when the <em>same window is called to open a <strong>second time</strong>.</em></p>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>File "C:\Users\Owatch\Documents\Unisung\Produced Content\NetSendClient[0.9]\files\Program_Files\NS[9].py", line 208, in SCN
      Window.tk.call("wm","iconphoto",Window._w, Thumbnail)
  _tkinter.TclError: can't use "pyimage4" as iconphoto: not a photo image
  </code></pre>
  
  <p>I'm not sure why this error occurs the second time the window is opened. To give some more information on why it needs to be reopened. When a user presses a button inside this window, it triggers a function that <strong>calls the window to be destroyed before it is later reopened</strong>. So maybe it's because it's <em>not being cleanly disposed of or something</em>. I don't know. Thanks for helping!</p>