function to changes images after