modified GET_PWD_QUERY to get student photo