Fix crash when trying to load progressive jpeg due to uninitialized s->img_n

Proper pointer check before deleting