small rearrangements of the code
updated code for generating showcase image