js autogeneration of images