Now this is a wild hunch, but I just remembered a similar problem. Thus, I was able to reproduce your "blue box", so this may be your problem. I will just try it.
I assume that PhotoImage is being created in some other area (maybe the showImage(self, id) method or something like that) and no reference to it goes beyond the scope of this method. This causes PhotoImage to collect garbage at the end of this method, even if it is used in a shortcut!
Try to create a variable that exists throughout the life of the frame and bind PhotoImage to this variable (for example, self.images[ID] when using the class for the GUI or some other global variable otherwise). If I'm right, and this is really a problem, then this should help.
source share