the problem was that I didn't have permission to READ the photo directory from Atomic UC4 (which was running the script)