Before deploying my laravel project on Vultr Ubuntu Ngix i was able to upload images locally but any time i try uploading picture on my liveserver, it takes time to load and end up giving 504 Gateway Timeour nginx/1.16.1 (Ubuntu)
the figures is depend on your application need, but it's big for me...
anyway, try set max_execution_time = 120 for testing purpose... if it's still fail it may be other configuration/permission issue causing the error, try to find any server logs it may help..