The PHP MongoDB driver will attempt to "cleanup" failed writes to GridFS, however if the primary crashed then we cannot access any primary to execute the cleanup routines on.
The data will therefore still be there in the chunks collection, but the metadata (and the actual file information) will not, as that is not written until the entire GridFS write has successfully completed.
In general this is not a problem as you shouldn't be experiencing a lot of failovers. If however this is an actual concern that you are storing few megabytes of data that you can't really access, then you would need to create some sort of background/cronjob task that would iterate over the chunks collection and detect orphan chunks. Be careful though, as you don't want to be deleting chunk that are currently being created :)