updated js for changing image fadein and out