Thread:Project:Support desk/Get list of File-pages referred to by subset of pages

I want to get a list of all pages in the File-namespace which is referred to by a wikipages given in a list (I want to export a subset of pages including referred images).

Assume I've this pages (Page A_1 includes File:10.jpg and so on):

A_1 -> File:10.jpg

A_2 -> File:11.jpg

A_3 -> File:12.jpg File:20.jpg

B_1 -> File:13.jpg File:20.jpg

B_2 -> File:14.jpg

B_3 -> File:15.jpg

C_1 -> File:16.jpg

C_2 -> File:17.jpg File:12.jpg

C_3 -> File:19.jpg

So for pages B_1, B_2, B_3 this should give: File:13.jpg, File:20.jpg, File:14.jpg and File:15.jpg.

Is there some script or API-call to achieve this?

Thanks in advance for your help. Jethro