created center image function for modal image