Move the notifications to better callback
as after_update and after_create are still inside
the transaction clients reacting to them get unpredictable
results depending on the timings
The locking from generate_images is removed as it didn't
really help with the problem it was supposed to solve and
there is now a cleaner way of doing things