Updated image deletion functionality.