Created Image Repository, changed logic a little bit.