jQuery Toggle w/ localStorage

So this script is suppose to toggle images and store the value into localStorage, works fine and dandy.
My problem is that if the images are already visible then when the toggle anchor is clicked nothing happens, unless the toggle anchor is clicked twice, since the first function of the toggle() is to show the hidden images and set the localStorage to 1. If I flip the functions then if they’re hidden when the page is loaded then it needs to be clicked twice to show the images. Maybe I’m just a little stupid, overlooking something probably simple, but who happens to know a fix for this?

var picImgs = $('#pictures_container div img');
var txtImgs = $('#texts_container div img');
var status;

$(function() {
    console.log('Loaded localStorage is: ' + localStorage['toggleProfileImages'])
    if(localStorage['toggleProfileImages'] == 0) {
        picImgs.hide()
        txtImgs.hide()

        $('#rm-imgs').text(
            'Show ' + Number(picImgs.length + txtImgs.length) + ' Image(s)'
        )
    }
    else {
        picImgs.show()
        txtImgs.show()

        $('#rm-imgs').text(
            'Hide ' + Number(picImgs.length + txtImgs.length) + ' Image(s)'
        )
    }

    if(picImgs.length || txtImgs.length > 0) {
        appendTo();
        toggle();
    };
});

function appendTo() {
    var liAttr = {id:'rm-wrap'};
    var linkAttr = {
        id: 'rm-imgs',
        href: '#'
    };
    $('<li>| </li>').attr(liAttr).appendTo('#viewer #header_right');
    $('<a></a>').attr(linkAttr).appendTo('#rm-wrap');
    $('#rm-imgs').css({'cursor':'pointer','user-select':'none'})
}

function toggle() {
    $('#rm-imgs').text(
        'Hide ' + Number(picImgs.length + txtImgs.length) + ' Image(s)'
    ).toggle(
        function display() {
            $(this).text(
                'Hide ' + Number(picImgs.length + txtImgs.length) + ' Image(s)'
            )
            picImgs.show();
            txtImgs.show();

            var status = 1;
            localStorage['toggleProfileImages'] = status;
            console.log('localStorage is: ' + localStorage.getItem('toggleProfileImages'))
        },
        function remove() {
            $(this).text(
            'Show ' + Number(picImgs.length + txtImgs.length) + ' Image(s)'
            )
            picImgs.hide();
            txtImgs.hide();

            var status = 0;
            localStorage['toggleProfileImages'] = status;
            console.log('localStorage is: ' + localStorage.getItem('toggleProfileImages'))
        }
    )
}