Responsive image resizing via PHP, GD, Javascript