Image URL not immediately available after upload

I am facing the issue that immediately after I upload an image, the image URL is not available in the server response. If I wait for a second and then refresh, then the image is available. Is this because the server is taking time to generate thumbnails? How do I avoid this bug if I want the image immediately in the response?

I can confirm that this is a bug introduced sometime between 4.9.0 and 4.9.2.

Never mind seems like it exists even in 4.9.0

Update: the only way I could fix this was to include a short delay between when I upload the picture and query the API again.