title: Python 3.6 tkinter image "pyimage20" doesn't exist
body: <p>Trying to add a button with background image on the main class of a multiple frame GUI. Works well when ran on a separate class on a separate window but gives: <strong>_tkinter.TclError: image "pyimage20" doesn't exist</strong> error when ran in the main class. </p>
  
  <pre><code>button_pady = 5
  
  self.homebutton_image = tki.PhotoImage(file="Images/Resized/homebutton.png")
  
  self.homebutton = tki.Button(self, image=self.homebutton_image, compound=BOTTOM)
  
  self.homebutton.image = self.homebutton_image
  
  self.homebutton.pack(side=TOP, pady=button_pady)
  </code></pre>
  
  <p>Main class has been defined such as:</p>
  
  <pre><code>class MainClass(tk.Tk):
  
      def __init__(self, *args, **kwargs):
  
          tk.Tk.__init__(self, *args, **kwargs)
  </code></pre>
  
  <p>Any idea why this occurs?
  Have looked at a lot of other questions but nothing helped so far.
  When self is removed so the following line looks like it works well:</p>
  
  <pre><code>self.homebutton = tki.Button(image=self.homebutton_image, compound=BOTTOM)
  </code></pre>
  
  <p>Which i think it means that there is an issue with the class.</p>
  
  <p>Thanks!</p>