You are not resetting the state.
if(data[position].contains(".jpg") || data[position].contains(".png"))
{
image.setVisibility(View.VISIBLE);
imageLoader.DisplayImage(data[position], image);
}else{
image.setVisibility(View.GONE);
}
Also I would advise a loading state where the image is set to default drawable or a progressbar is shown instead of the image.