Fix bug that caused first page of documents to be converted into images twice