handling session states in images detail view