Fixing a bug where the selected button image would be flipped