Images upload via API sometimes results in an image with filesize = 0

Anyone ever faced this problem? When uploading via API I only get a 204 status code without any details so I have to make an additional searchMedia call in order to verify the file’s filesize is greater than 0 for every image I uploaded. It would at least help if I could configure the system so it doesn’t create such image hulks without content, is this possible?

Regards, Michael