Made image rendering more efficient