fix issue with image links and add some code for legacy projects