If you draw Mickey Mouse with a pencil and you publish (and sell) the drawing who is getting the blame? Is the pencil infringing the copyright? No, it's you.
Same with AI. There is nothijg wrong with using copyrighted works to train an algorithm, but if you generate an image and it contains copyrighted materials you are getting sued.
Merely making a copy can definitely be infringement. "Copies" made in the computing context even simply between disk and RAM have been held to be infringement in some cases.
Fair use is the big question mark here, as it acts to allow various kinds of harmless/acceptable/desirable copying. For AI, it's particularly relevant that there's a factor of the "transformative" nature of a use that weighs in favor of fair use.
That said, there is also an inherent right to copy material that is published online in certain circumstances. Indeed, the physical act of displaying an image in a browser involves making copies of that image in cache, memory, etc.