added image resizing and split into separate source files