Handle all possible errors when uploading files (see #5934)
Backport the changes from e44864d2 (see #5683)
Update TCPDF to version 6.0.010 (see #5676)