Sure, it would be hard, there's some projects that might be able to help out however, e.g.
https://github.com/pa7/nude.js. It's not an easy problem to solve but it's possible. You could also start the service with 2-5 of 1123581321's example or just 2-4 and wait to see what your customers request.