Added image comparison function