I believe what actually happens here is that this gets put in as a subquery (so we never actually get the list of photo ids into python at all)