store the last previous image and support prev button