The question, given your particular example, would be why does a developer want to develop a mechanism to store and retrieve images so that users can add/view images wherever required, unless a user wants to add or view images?
That is, while your question is a good one, the example isn't. This is a user feature and should have a user story. And if the user doesn't really need that functionality then the developer shouldn't want to do it.
A technical story is more "As a developer, I want to reduce duplication in the data-archiving modules, so that I don't have to make every change in 6 places."
The question of whether these should be included in the sprint is a difficult one, and it depends somewhat who you consider to be your customer. Is it the end user, or the business who employs you, or the business who employs the business who employs you?
A lot of industry opinion-guiding is done by people who work for consultancy companies. From that perspective, I can see the argument that developer stories are bad. They should just be a part of what you do, day-to-day, invisible to the company that's paying for it. Those companies instinctively know that running up the bills too high ensures that your work dries up, so every developer works on a principle of doing only technical development that improves your development time, or improves your ability to release bug-free software.
My experience is more with working on in-house teams, providing software directly to the company who pays my wages. In many of those companies, there is a trust barrier between the business and the technical wing of the business. In all of them, there is a different mentality, where decreasing costs are every bit as increasing income.
In those environments, it can be good to define significant developer stories. It increases visibility, engendering trust, and encourages developers and management alike to think about the value of such tasks to the business and prioritise accordingly.
Ultimately, I suggest you try it. And, if it doesn't offer value, stop doing it.
But my instinct says that if you were considering the value of this development to the business, you wouldn't even have tried to make it a developer story. It's either good for the end user or it isn't. If it isn't then there's no value to the business.