Interpretation of capillary discharge EUV pinhole images using a ray-tracing code