add code for image snap