session logic update for img code