def show_image(request, image_id, task_id):
    try:
        task = Task.objects.get(pk=task_id)
        image = ImageSequence.objects.get(pk=image_id)
        frame = int((image.nr_of_frames / 2))
        filename = image.format.replace('#', str(frame))
    except Task.DoesNotExist:
        raise Http404('Task does not exist')
    except ImageSequence.DoesNotExist:
        raise Http404('Image does not exist')
    return get_image_as_http_response(filename, task.post_processing_method)
def show_image(request, image_id, task_id):
    try:
        task = Task.objects.get(pk=task_id)
        image = ImageSequence.objects.get(pk=image_id)
        frame = int((image.nr_of_frames / 2))
        filename = image.format.replace('#', str(frame))
    except Task.DoesNotExist:
        raise Http404('Task does not exist')
    except ImageSequence.DoesNotExist:
        raise Http404('Image does not exist')
    return get_image_as_http_response(filename, task.post_processing_method)