More refactoring on image display.