script to save images