The following snippet will let you create greybox imageset from images attached to WordPress post.

Snippet Source/Credit: Snipplr