def show_frame(request, image_sequence_id, frame_nr, task_id):
    try:
        task = Task.objects.get(pk=task_id)
        image_sequence = ImageSequence.objects.get(pk=image_sequence_id)
    except Task.DoesNotExist:
        raise Http404('Task does not exist')
    except ImageSequence.DoesNotExist:
        raise Http404('Image sequence does not exist')
    filename = image_sequence.format.replace('#', str(frame_nr))
    return get_image_as_http_response(filename, task.post_processing_method)
def show_frame(request, image_sequence_id, frame_nr, task_id):
    try:
        task = Task.objects.get(pk=task_id)
        image_sequence = ImageSequence.objects.get(pk=image_sequence_id)
    except Task.DoesNotExist:
        raise Http404('Task does not exist')
    except ImageSequence.DoesNotExist:
        raise Http404('Image sequence does not exist')
    filename = image_sequence.format.replace('#', str(frame_nr))
    return get_image_as_http_response(filename, task.post_processing_method)