Cleanup retry logic in uploadFile