move image creation into module