add image and modify gallery code