Use tempfile when small image file. Fixes GH-8