Backport "Set sane permissions on system.img and SWAP.img"

commit b80e231e08d6ec170c57145a94b42db67ac27613

Change-Id: I2910f99624d48e3b2be80a549fd26061d8e28dae
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>