This is a small WordPress function that get images attached to a post.