X-ray imaging with nanophotonic scintillators