Some cleanup and added working with image data reference rather that full object.

Working with the reference should add it a little bit of speed.
Updated global time scale and removed if statement