added image inversion