extractSqlite: catch IO errors on writeImage