refactor the displaying of pictures into functions
final touch up