Added performance hacks to improve rendering time for large pixel matricies.