minor changes to image code