Reconfigurable topological phases in photoexcited graphene nanoribbon arrays