Formation of a graded-index waveguide in UV exposed polyimide