$(function() {
    if ($("#frame") && $("#frame").children().length <= 1) {
        if ($("#frame").children().length == 1) {
            $("#frame :first").show();
        } else {
            $("#picture_frame").hide();
        }
    } else {
        $("#frame").cycle({
            fx:      'fade',
            random: 1,
            timeout: 5000
        });
    }
});
