Updating nextItem and prevItem functions to add alt attribute to images