Yes, the amount of memory needed is probably very large, which is why I restricted the number of images to 64 just to see if the rest of the code works.
I managed to upgrade tensorflow to the latest version (TF2.5), and now if I write
for img, path in image_dataset:
    pass

the kernel doesn’t die anymore, but I get an error:
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-20-55361e928603> in <module>
----> 1 for img, path in image_dataset:
      2     pass

~\anaconda3\envs\TF2_5\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py in __next__(self)
    759   def __next__(self):
    760     try:
--> 761       return self._next_internal()
    762     except errors.OutOfRangeError:
    763       raise StopIteration

~\anaconda3\envs\TF2_5\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py in _next_internal(self)
    745           self._iterator_resource,
    746           output_types=self._flat_output_types,
--> 747           output_shapes=self._flat_output_shapes)
    748 
    749       try:

~\anaconda3\envs\TF2_5\lib\site-packages\tensorflow\python\ops\gen_dataset_ops.py in iterator_get_next(iterator, output_types, output_shapes, name)
   2722       _result = pywrap_tfe.TFE_Py_FastPathExecute(
   2723         _ctx, "IteratorGetNext", name, iterator, "output_types", output_types,
-> 2724         "output_shapes", output_shapes)
   2725       return _result
   2726     except _core._NotOkStatusException as e:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 117: invalid continuation byte