move from arrays for links and images to arraylists