Download the images first and then create the pipeline?

If you’re running more than one epoch that might be a good idea.
If you build it as a tf.data.Dataset then ds.snapshot might have the same effect.