Frequency downconversion and ghost imaging: classical and quantum approaches