Fix issue for tracking total raster count when images are broken

Note - currently there’s an issue with the URN calculation not handling
mixed cases since the URN value is pushed into lower case and then
violates the unique constraint