p1: optimize JPEG memory configuration