I think you can filter on last created, but agree last used would be helpful:
docker image prune -a --filter "until=24h"