[TASK] Exclude directories from batch processing

Change-Id: I5fd7bc788933418ed6fd33985ce1abbfbe12bcb2
Resolves: #53517
Reviewed-on: https://review.typo3.org/25260
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers