script to connect images