only set imagesdir if not previously defined