Better check for undefined value

Better check for undefined value, fixes right arrow showing when it shouldn't
Help when used with carousel plugin.