Figure 1 shows the related images ordered by ID and Figure 2 shows the images ordered by image. In the finished application, you will be able to click the Spry table's headers to change the sorting criteria

Figure 1. Related images ordered by ID

Figure 2. Related images ordered by image