Implemented below mentioned changes :

1. Break the larger functions into multiple smaller one.
2. Optimezed the code.
3. Make noOFImageBox dynamic.