Photon–hadron discrimination with improved clustering for a preshower detector in high energy heavy ion experiments