Implemented custom script for image selection