Added better handling of existing queries on the view all images admin page.