Restore a consistent state after errors [#7]

(using layout.css in the tests because it should avoid any extraneous db
interactions other than the after_request hooks under test)

There is still a way for celery's and the database's states to fall
out of sync; for example a complete network failure between calling
delay() and calling commit() could result in enqueued tasks referring to
ids that aren't in the DB. However, I don't see a way to structure it
that doesn't leave *some* window, and I believe this one is sufficiently
small.
Put to-enqueue tasks on the request-local context [#7]

This probably should've happened sooner...the list of tasks to enqueue
needs to go away after each request, or tasks will be re-enqueued at the
end of subsequent requests.
If any task fails queueing, revoke its neighbors [#7]

Since we are about to roll back, the successfully-enqueued tasks may
have references to DB keys that won't exist.
Just give up in the face of invalid image_contents [#7]

Obviously the app should do everything it can to avoid this case, but if
it does arise, it's unrecoverable: that image_contents_id isn't going to
suddenly show up, so retrying will do no good.
Merge branch 'rollback-errors'