Switch image loading to ajax