optimize image rendering