moving img functions to seperate class