You don't say your server-side language, so if it's PHP there is a few function who provide thumbnailing:
I don't really understand your problem with your callback invocation. But if you want to execute something later you can use cron, or queue services (like Iron.io).