Create an adaptive image through code