core-4780 fix file size calculation logic