Like the Title, is this possible?
I only need the width and height, so loading the image into ram would be unnecessary.
Check this SO question: Getting image dimensions without reading the entire file
This shows you how to extract this information from the image header without reading the entire file. Usually, the image files contain metadata at the start containing width and height in addition to other data, so that will be the quickest way of retrieving this information.
There is example code here that shows how you can read the header of images to get the width and height without loading and decoding the entire file. Obviously the approach is different for different image types though, so you may need to write your own if you are using something a little more exotic.
Only if you read the binary format manually.
Another option, save image dimensions in the database as you put images there. They will then be available to you without the need of image loading.
Depending on the image format you can extract the metadata with a library (e.g. EXIF for jpeg)
Maybe this SO question might help: What is the best EXIF library for .Net?