<?php
	
	require("assets/IsMobile.php");

	$document_root  = $_SERVER['DOCUMENT_ROOT'];
	$requested_uri  = parse_url(urldecode($_SERVER['REQUEST_URI']), PHP_URL_PATH);
	$source_file    = $document_root.$requested_uri;

	header("Content-Type: image/jpeg");

	if(IsMobile::detect())
	{
		// small
		readfile($source_file);
	}
	else
	{
		// big
		readfile( substr_replace($source_file, "_big.jpg", -4) );
	}

	


	
?>