Fix image deletion.
Refactor sources implementation.