I tried this code and this is working for me.
var userAgent = HttpContext.Current.Request.UserAgent.ToLower();
if (userAgent.Contains("ipad;"))
{
OImgPath = "../images/ipad/" + objGet.Image3;
}
else
{
OImgPath = "../images/OriginalImage/" + objGet.Image3;
}