preventing SQL injection and resizing images