image flag bug fix