image index click functionallity