flip image bug fix