better handle deleted docs in case pillow
Merge pull request #5084 from dimagi/none-case

better handle deleted docs in case pillow