fixing potential issue when expiring photos