Fixing potential issue when expiring photos

I haven't actually seen it happen, but just by looking at the code I can tell you would end up with out of indexes when expiration happens.