Thanks for the reply @gkalyan , @PGURUKRISHNA . I have identified the issue - jcr:content node was missing for one of the parent pages which is why the null pointer exception was encountered. But, now I am not sure how to rewrite the links for images. It still points to c:/content/dam and not c:/var...