old_contents: from itertools import chain
  
  from django.contrib.auth.models import AnonymousUser
  
  from core.models import Application as Image
  from core.models import AtmosphereUser
  from core.query import only_current, only_current_machines
  
  from api.v2.serializers.details import ImageSerializer
  from api.v2.views.base import AuthOptionalViewSet
  
  
  class ImageViewSet(AuthOptionalViewSet):
      """
      API endpoint that allows images to be viewed or edited.
      """
      serializer_class = ImageSerializer
      filter_fields = ('created_by__username', 'tags__name')
      search_fields = ('name', 'description', 'tags__name',
                       'tags__description', 'created_by__username')
      http_method_names = ['get', 'head', 'options', 'trace']
  
      def get_queryset(self):
          request_user = self.request.user
          public_image_set = Image.objects.filter(
              only_current(), private=False).order_by('-start_date')
          if type(request_user) == AnonymousUser:
              # Anonymous users can only see PUBLIC applications
              # (& their respective images on PUBLIC providers)
              # that have not been end dated by Owner/Admin.
              return public_image_set
          elif type(request_user) == AtmosphereUser:
              # All my images (Regardless of 'end dates' or public/private
              my_images = request_user.application_set.all()
              # Non-end dated machines that have
              # been EXPLICITLY shared with me
              privately_shared = Image.objects.filter(
                  only_current_machines(),
                  providermachine__members__id__in=request_user
                  .group_set.values('id'))
              return (public_image_set |
                      my_images |
                      privately_shared).distinct()
          else:
              return Image.objects.none()
  
new_contents: from itertools import chain
  
  from django.contrib.auth.models import AnonymousUser
  from django.shortcuts import get_object_or_404
  
  from rest_framework.response import Response
  
  from core.models import Application as Image
  from core.models import AtmosphereUser
  from core.query import only_current, only_current_machines
  
  from api.v2.serializers.details import ImageSerializer
  from api.v2.views.base import AuthOptionalViewSet
  
  
  class ImageViewSet(AuthOptionalViewSet):
      """
      API endpoint that allows images to be viewed or edited.
      """
      serializer_class = ImageSerializer
      filter_fields = ('created_by__username', 'tags__name')
      search_fields = ('name', 'description', 'tags__name',
                       'tags__description', 'created_by__username')
      http_method_names = ['get', 'head', 'options', 'trace']
  
      def get_queryset(self):
          request_user = self.request.user
          public_image_set = Image.objects.filter(
              only_current(), private=False).order_by('-start_date')
          if type(request_user) == AnonymousUser:
              # Anonymous users can only see PUBLIC applications
              # (& their respective images on PUBLIC providers)
              # that have not been end dated by Owner/Admin.
              return public_image_set
          elif type(request_user) == AtmosphereUser:
              # All my images (Regardless of 'end dates' or public/private
              my_images = request_user.application_set.all()
              # Non-end dated machines that have
              # been EXPLICITLY shared with me
              privately_shared = Image.objects.filter(
                  only_current_machines(),
                  providermachine__members__id__in=request_user
                  .group_set.values('id'))
              return (public_image_set |
                      my_images |
                      privately_shared).distinct()
          else:
              return Image.objects.none()
  
      def retrieve(self, request, pk=None):
          queryset = Image.objects.all()
          image = get_object_or_404(queryset, pk=pk)
          serialized = ImageSerializer(image, context={"request": request})
          return Response(serialized.data)
  
subject: Fix /api/v2/images/id to serve all data instead of just current data.