Json conversion is added. Watchdog error handling added. We don't use count of pages to determine if file is ready for showing or not.