added /waiting endpoint to get number of lasted images