Is it possible to include image files in Generators?

I’m trying to convert a script that uses image files. Is there a way to
include images in the generators itself? (e.g.

I tried it, but it says:

“You have a nil object when you didn’t expect it! You might have
expected an instance of Array. The error occurred while evaluating

Any ideas?