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

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