I made sure that my dataset contained all images in jpeg format. I read somewhere to use tf.image.decode_jpeg() but do I still need it even though all files are in jpeg format.