Calculate JPEG size