State-selective imaging of cold atoms