In order to enhance the application's resilience to errors, what adjustments should be implemented considering that occasional uploads fail, resulting in an HTTP 504 Gateway Timeout error when using the Cloud Client Library to upload an image to Cloud Storage?