Lazy Parallelization: A Finite State Machine Based Optimization Approach for Data Parallel Image Processing Applications