Ultrafast lattice response of photoexcited thin films studied by X-ray diffraction