Mass shift of neutral vector and pseudoscalar bosons near the critical temperature and its observation by electromagnetic probes