<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def next(self):
        ''' Returns next image for same content_object and None if image is
        the last. '''
        try:
            return self.__class__.objects.for_model(self.content_object,
                                                    self.content_type).\
                            filter(order__lt=self.order).order_by('-order')[0]
        except IndexError:
            return None