You can make your block non-cacheable by adding cacheable="false" attribute to it in the layout xml:
<block class="Magento\Framework\View\Element\Template" name="custom_header" as="custom_header" template="Magento_Theme::html/custom_header.phtml" before="-" cacheable="false">
I also faced the same issue and found solution in some post. you need to override the core function _setUploadFileId() to fix this issue.
file path is vendor/magento/framework/File/Uploader.php
change _setUploadFileId() code with the below one and it will fix the issue for you :)
private function _setUploadFileId($fileId)