some code rearanging and more work on ribbons/images...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>