Did you store the x-ray images in some kind of binary data or do you have each image stored separately?
In the latter case, have a look at the Data Loading Tutorial 68 to see how to create a custom Dataset.