fix capped size image serving
use mktmp