Updated image slider code to transition