add option to disable image scaling and fixed a flash bug on initial load