Fixed a bug where the wrong image was being drawn for the panel