Script for image transition