script to retrieve thumb pictures