script to work on selected images, not on those from central image table