flip image function
flip flags