 		if @gallery_index + 1 < @gallery_items.length
 			next = $(@gallery_items.get(@gallery_index + 1), false)
 			src = next.attr('data-remote') || next.attr('href')
-			if @isImage(src)
+			if @isImage(src, next.attr('data-type'))
 				@preloadImage(src, false)
 
-	detectRemoteType: (src) ->
-		if @isImage(src)
+	detectRemoteType: (src, type) ->
+		if type == 'image' || @isImage(src)
 			@preloadImage(src, true)
-		else if video_id = @getYoutubeId(src)
+		else if type == 'youtube' || video_id = @getYoutubeId(src)
 			@showYoutubeVideo(video_id)
-		else if video_id = @getVimeoId(src)
+		else if type == 'vimeo' || video_id = @getVimeoId(src)
 			@showVimeoVideo(video_id)
 		else
 			@error "Could not detect remote target type. Force the type using data-type=\"image|youtube|vimeo\""

		@updateTitleAndFooter()
		src = @$element.attr('data-remote') || @$element.attr('href')

		@detectRemoteType(src)

	navigate_right: ->


			$(document).on 'keydown.ekkoLightbox', @navigate.bind(@)

			# add the directional arrows to the modal
			if @options.directional_arrows && @gallery_items.length > 1
				@lightbox_container.prepend('<div class="ekko-lightbox-nav-overlay"><a href="#" class="'+@strip_stops(@options.left_arrow_class)+'"></a><a href="#" class="'+@strip_stops(@options.right_arrow_class)+'"></a></div>')
				@modal_arrows = @lightbox_container.find('div.ekko-lightbox-nav-overlay').first()
				@lightbox_container.find('a'+@strip_spaces(@options.left_arrow_class)).on 'click', (event) =>
