Backup before image support. After image support is in I'll completely overhaul everything. Nicer naming and consistent code for a start.