Add end-of-directory flag to image.