change gallery activity - working function