Calculating the Total Number of Images