sort out image paths