Given the start of the problem you explained I would be heading for a partically blocked pilot light which is slowly getting worse – a poor flame length on the thermocouple will cause the pilot light to drop out and given that the pilot is going and will stay alight once you have lit it I would look to the pilot burner first.
Selgas Services Ltd Craftsman Gasfitters, Plumbers, Electrical Service Technicians