this should not be named unsent messages
remove duplicate code by adding populatePendingFileAttachments()