1. Changed the functionality to use NextImageNumber in Database to improve efficiency.
2. Updated the code to update the NextImageNumber in memory as well to reduce database access calls
3. Updated the code to implement scrolling correctly
4. Updated the threshold values to reduce the number of times the back ground changes.