Fixed bug in format script and image indexer