imgpyr: Guard against negative sequence length