refactored code by creating picture object constructor, and adjusting things accordingly. It works, but I've only set it up for first 3 pics