Analysing retinal images using (extended) persistent homology