calculate jpeg size only for supported files, report correct sizes for directories