Precache the data for the next image with a service worker in the background to reduce loading time on image change.