Update image logic

Have to re-link the old image so Cascade doesn’t create an empty link.
Also some more PEP8.